<include file="Public/header"/>
<div class="vertical-container">
    <div class="row wrapper page-heading m-t">
        <div class="col-lg-12 panel-body" style="background: #21b9bb;color: #fff;font-size: 14px;font-weight:600">
            <span class="m-r-lg">订单编号：{$data.order_number}</span>
            <span class="m-r-lg">区域：{$data.area_name}</span>
            <span class="m-r-lg">经销商：{$data.company_name}</span>
            <span class="m-r-lg">客户名：{$data.username}</span>
            <span class="m-r-lg">电话：{$data.mobile_phone}</span>
            <if condition="$data.status eq 1">
                <a href="{:U('Orders/completeOrder?rid='.$rid)}" class="btn btn-warning pull-right confirms ajax-get" >点击完成订单</a>
                <elseif condition="$data.status eq 2"/>
                <input type="button" class="btn btn-success pull-right" value="订单已完成"/>
            </if>

        </div>
    </div>
</div>
<div class="wrapper " style="margin-bottom: 60px;">
    <div id="vertical-timeline" class="vertical-container light-timeline" style="margin-top: 0">

        <volist name="_list" id="vo">
        <div class="vertical-timeline-block">
            <div class="vertical-timeline-icon navy-bg">
                <i class="fa fa-chevron-down"></i>
            </div>
            <div class="vertical-timeline-content">
                <h2>{$vo.title}</h2>
                <p>{$vo.content}</p>
                <a href="{:U('Orders/rdelete?tid='.$vo['tid'].'&rid='.$vo['rid'])}" class="btn btn-sm btn-primary m-l confirm ajax-get">删除</a>
                <a class="btn btn-sm btn-info" data-toggle="modal" onclick="edits({$vo.tid},'{$vo.title}','{$vo.content}',{$vo.pr_id})" data-target="#editInfo">编辑</a>
                <small class="text-danger"><b>{$vo.t_time|date='Y-m-d H:i:s',###}</b></small>
            </div>
        </div>
        </volist>



        <!--编辑信息弹出框-->
        <div class="modal inmodal" id="editInfo" tabindex="-1" role="dialog" aria-hidden="true">
            <form  method="post" class="form-horizontal-s" action="{:U('Orders/editOrder')}">
            <div class="modal-dialog">
                <div class="modal-content animated bounceInRight">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">
                            <span aria-hidden="true">&times;</span>
                            <span class="sr-only">关闭</span>
                        </button>
                        <h4>编辑信息</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label>订单工序</label>
                            <select id="pr_edit" name="pr_id" class="form-control">
                                <option value="">请选择</option>
                                <volist name="parr" id="vs">
                                    <option value="{$vs.pr_id}">{$vs.processname}</option>
                                </volist>
                            </select>
                        </div>
                        <div class="form-group">
                            <label>标题</label>
                            <input id="title" name="title" type="text" class="form-control">
                        </div>
                        <div class="form-group">
                            <label>内容</label>
                            <textarea id="content" name="content" class="form-control" rows="5" ></textarea>
                        </div>
                    </div>
                    <input type="hidden" id="tid" name="tid" value=""/>
                    <input type="hidden" name="rid" value="" id="orderid"/>
                    <div class="modal-footer">
                        <button type="submit" target-form="form-horizontal-s" class="btn btn-primary ajax-post">保存</button>
                        <button type="button" class="btn btn-info" data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </div>
       </form>
        </div>



        <!--添加信息按钮-->
        <div class="vertical-timeline-block">
            <div class="vertical-timeline-icon yellow-bg" data-toggle="modal" data-target="#addInfo">
                <i class="fa fa-plus"></i>
            </div>
        </div>
        <!--添加信息弹出框-->
        <div class="modal inmodal" id="addInfo" tabindex="-1" role="dialog" aria-hidden="true">
            <form  method="post" class="form-horizontal" action="{:U('')}">
            <div class="modal-dialog">
                <div class="modal-content animated bounceInRight">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">
                            <span aria-hidden="true">&times;</span>
                            <span class="sr-only">关闭</span>
                        </button>
                        <h4>添加状态信息</h4>
                    </div>
                    <input type="hidden" name="rid" value="{$rid}"/>
                    <div class="modal-body">
                        <div class="form-group">
                            <label>订单工序</label>
                            <select name="pr_id" class="form-control">
                                <option value="">请选择</option>
                                <volist name="parr" id="vs">
                                    <option value="{$vs.pr_id}">{$vs.processname}</option>
                                </volist>
                            </select>
                        </div>
                        <div class="form-group">
                            <label>标题</label>
                            <input type="text" name="title" placeholder="请输入标题" class="form-control">
                        </div>
                        <div class="form-group">
                            <label>内容</label>
                            <textarea class="form-control" name="content" rows="5" placeholder="请输入内容"></textarea>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" target-form="form-horizontal" class="btn btn-primary ajax-post">提交</button>
                        <button type="button" class="btn btn-info" data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </div>
            </form>
        </div>
    </div>

</div>
<include file="Public/footer"/>
<script src="__Public__/Admin/js/plugins/layer/layer.min.js"></script>
<script>
    var rid='{$rid}';

    function edits(tid,title,content,pr_id){
        $("#title").val(title);
        $("#tid").val(tid);
        $("#content").val(content);
        $("#orderid").val(rid);
        $("#pr_edit").val(pr_id);
    }

</script>